package com.example.zqm.git72.Model;

import com.example.zqm.git72.JavaBean.Master;
import com.example.zqm.git72.Service.ActivityService;
import com.example.zqm.git72.Service.MasterService;

import retrofit2.Call;
import retrofit2.Retrofit;
import retrofit2.converter.gson.GsonConverterFactory;

/**
 * Created by Administrator on 2017/4/26.
 */

public class MasterModel {
    private Retrofit retrofit;
    public MasterModel(){

        //联网获取网络上的数据
         retrofit = new Retrofit.Builder()
                .baseUrl("http://172.24.10.175/")
                .addConverterFactory(GsonConverterFactory.create())
                .build();
    }

    public Call getList()
    {
        MasterService masterService=retrofit.create(MasterService.class);
        return masterService.getList();
    }
  public  Call getMasterById(String id)
{
    MasterService masterService =retrofit.create(MasterService.class);
    return masterService.getMasterById(id);
}
    public Call getListfaq(String master_id)
    {
        MasterService masterService=retrofit.create(MasterService.class);
        return  masterService.getListfaq(master_id);
    }

    public Call createFaq(String user_id,String master_id,String question)
    {
        MasterService masterService =retrofit.create(MasterService.class);
        return  masterService.createFaq(user_id,master_id,question);
    }
    public  Call iscollect(String fan_id, String user_id){
        MasterService masterService =retrofit.create(MasterService.class);
        return  masterService.iscollect(fan_id,user_id);
    }
    public  Call decollect(String fan_id, String user_id){
        MasterService masterService =retrofit.create(MasterService.class);
        return  masterService.decollect(fan_id,user_id);
    }

//    public  Call getVideo(String id){
//        MasterService masterService = retrofit.create(MasterService.class);
//        return  masterService.getVideo(id);
//    }
}
